﻿<Page x:Class="Hotel.WPF.ui.Facturation.P_Facture"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:extToolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
      mc:Ignorable="d" 
      d:DesignHeight="608" d:DesignWidth="1050"
	Title="P_Facture" Loaded="Page_Loaded">
    <extToolkit:BusyIndicator IsBusy="False" BusyContent="Chargement de la page en cours..." x:Name="busyTool" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,2,0,0" >
        <Grid VerticalAlignment="Top" HorizontalAlignment="Left" Width="964">
            <Label Content="EDITION DE FACTURE" Height="28" Margin="10,4,12,0" Name="label1" VerticalAlignment="Top" Background="#FFD3DCF2" FontWeight="Bold" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
            <TabControl Height="534" Margin="10,38,12,0" Name="tbTC" VerticalAlignment="Top">
                <TabItem Header="Facturation" Name="ti_tc">
                    <Grid>
                        <GroupBox Header="Client" Height="73" HorizontalAlignment="Left" Margin="10,5,0,0" Name="gb_Client" VerticalAlignment="Top" Width="667">
                            <Grid>
                                <Label Content="Client" Height="28" HorizontalAlignment="Left" Margin="195,6,0,0" Name="label2" VerticalAlignment="Top" FontWeight="Bold" />
                                <Label Content="N° Facture" Height="28" HorizontalAlignment="Left" Margin="7,7,0,0" Name="label3" VerticalAlignment="Top" FontWeight="Bold" />
                                <TextBox Height="23" HorizontalAlignment="Left" Margin="79,8,0,0" Name="tb_numFacture" VerticalAlignment="Top" Width="107" />
                                <TextBox Height="23" HorizontalAlignment="Left" Margin="241,8,0,0" Name="tb_client" VerticalAlignment="Top" Width="213" />
                                <Label Content="N° Chambre" Height="28" HorizontalAlignment="Left" Margin="474,4,0,0" Name="label4" VerticalAlignment="Top" FontWeight="Bold" />
                                <TextBox Height="23" HorizontalAlignment="Left" Margin="557,6,0,0" Name="tb_numChambre" VerticalAlignment="Top" Width="75" />
                            </Grid>
                        </GroupBox>
                        <GroupBox Header="Facturation" Height="196" HorizontalAlignment="Left" Margin="14,83,0,0" Name="gb_facturation" VerticalAlignment="Top" Width="663">
                            <Grid>
                                <Label Content="Montant" Height="28" HorizontalAlignment="Left" Margin="362,13,0,0" Name="label5" VerticalAlignment="Top" FontWeight="Bold" />
                                <Label Content="Date" Height="28" HorizontalAlignment="Left" Margin="362,45,0,0" Name="label6" VerticalAlignment="Top" FontWeight="Bold" />
                                <Label Content="Remise" Height="28" HorizontalAlignment="Left" Margin="362,80,0,0" Name="label7" VerticalAlignment="Top" FontWeight="Bold" />
                                <Label Content="N° Table" Height="28" HorizontalAlignment="Left" Margin="10,7,0,0" Name="label8" VerticalAlignment="Top" FontWeight="Bold" />
                                <Label Content="Elt à facturer" Height="28" HorizontalAlignment="Left" Margin="10,42,0,0" Name="label9" VerticalAlignment="Top" FontWeight="Bold" />
                                <Label Content="Description" Height="28" HorizontalAlignment="Left" Margin="10,78,0,0" Name="label10" VerticalAlignment="Top" FontWeight="Bold" />
                                <ComboBox Height="23" HorizontalAlignment="Left" Margin="96,43,0,0" Name="cb_itemFacture" VerticalAlignment="Top" Width="217" />
                                <TextBox Height="56" HorizontalAlignment="Left" Margin="96,76,0,0" Name="tb_description" VerticalAlignment="Top" Width="217" AcceptsReturn="True" />
                                <TextBox Height="23" HorizontalAlignment="Left" Margin="96,10,0,0" Name="tb_numTable" VerticalAlignment="Top" Width="73" />
                                <TextBox Height="23" HorizontalAlignment="Left" Margin="431,15,0,0" Name="tb_montant" VerticalAlignment="Top" Width="120" />
                                <DatePicker Height="25" HorizontalAlignment="Left" Margin="433,48,0,0" Name="dateFact" VerticalAlignment="Top" Width="118" />
                                <TextBox Height="23" HorizontalAlignment="Left" Margin="433,83,0,0" Name="tb_remise" VerticalAlignment="Top" Width="115" />
                                <Button Content="Remise" Height="23" HorizontalAlignment="Left" Margin="553,83,0,0" Name="bt_remise" VerticalAlignment="Top" Width="54" />
                                <Button Content="Ajouter" Height="23" HorizontalAlignment="Left" Margin="120,145,0,0" Name="bt_ajouter" VerticalAlignment="Top" Width="126" Click="bt_ajouter_Click" />
                                <Button Content="Annuler" Height="23" HorizontalAlignment="Left" Margin="382,145,0,0" Name="bt_cancel" VerticalAlignment="Top" Width="126" />
                                <Button Content="Modifier" Height="23" HorizontalAlignment="Left" Margin="251,145,0,0" Name="bt_modif" VerticalAlignment="Top" Width="126" />
                            </Grid>
                        </GroupBox>
                        <GroupBox Header="Récap. Facture" Height="206" HorizontalAlignment="Left" Margin="13,290,0,0" Name="gb_recap" VerticalAlignment="Top" Width="902">
                            <Grid>
                                <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}" Height="164" Margin="11,6,6,0" Name="dg_ItemFacture" VerticalAlignment="Top" CanUserAddRows="True">
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Binding="{Binding Numero_chambre}" Header="Chambre" IsReadOnly="True" Width="65" />
                                        <DataGridTextColumn Binding="{Binding Numero_facture}" Header="N° Facture" IsReadOnly="True" Width="80" />
                                        <DataGridTextColumn Binding="{Binding Date_Facturation}" Header="Date" IsReadOnly="True" Width="75" />
                                        <DataGridTextColumn Binding="{Binding Numero_Table}" Header="N° Table" IsReadOnly="True" Width="65" />
                                        <DataGridTextColumn Binding="{Binding Type_Item_Facture}" Header="Elt facturé" IsReadOnly="True" Width="120" />
                                        <DataGridTextColumn Binding="{Binding Description_Item_Facture}" Header="Description" IsReadOnly="True" Width="200" />
                                        <DataGridTextColumn Binding="{Binding Montant_Item_Facture}" Header="Montant" IsReadOnly="True" Width="65" />
                                        <DataGridTextColumn Binding="{Binding Remise_ID}" Header="Remise" IsReadOnly="True" Width="65" />
                                        <DataGridTemplateColumn Header="" Width="60">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <Button Click="gererListeItemFacture" CommandParameter="{Binding}" Content="Editer" Cursor="Hand" Name="editButton" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                        <DataGridTemplateColumn Header="" Width="65">
                                            <DataGridTemplateColumn.CellTemplate>
                                                <DataTemplate>
                                                    <Button Click="gererListeItemFacture" CommandParameter="{Binding}" Content="Supprimer" Cursor="Hand" Name="deleteButton" />
                                                </DataTemplate>
                                            </DataGridTemplateColumn.CellTemplate>
                                        </DataGridTemplateColumn>
                                    </DataGrid.Columns>
                                </DataGrid>
                            </Grid>
                        </GroupBox>
                    </Grid>
                </TabItem>

            </TabControl>
        </Grid>
    </extToolkit:BusyIndicator>
</Page>
